FROM java:openjdk-8-jdk

MAINTAINER qisheng.chen@xiaohuodui.cn

ARG APP_MODULE
ENV APP_MODULE ${APP_MODULE}
ARG APP_ENV
ENV APP_ENV ${APP_ENV}
ADD $APP_MODULE/target/*.jar app.jar
RUN sh -c 'touch /app.jar'
ENV JAVA_OPTS="-Dspring.profiles.active=$APP_ENV"
ENTRYPOINT [ "sh", "-c", "java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /app.jar" ]